#pragma once
#include <QDockWidget>
#include <QFrame>
#include <QDialog>

#include "Document.h"
#include "interfaces/FilterPlugin.h"
#include "ParametersFrame.h"

class MainWindow;

/// This is a replacement for the MeshlabStdDialog
class FilterDialog : public QDialog{
    Q_OBJECT

private:
    ParametersFrame* parFrame;
    RichParameterSet* parameters;
    FilterPlugin* filter;
    QWidget* parent;

public:
    FilterDialog(FilterPlugin* filter, RichParameterSet* parameters, QWidget* parent){
        this->filter = filter;
        this->parent = parent;
        this->parameters = parameters;
        /// Configure GUI
        this->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
        setAttribute(Qt::WA_DeleteOnClose,true);        
    }
    ~FilterDialog(){ 
        // qDebug() << "~FilterDialog()"; 
    }
    
    /// Creates and shows the dialog (if necessary)
    /// Returns true only if user interaction is required (i.e. GUI initialized)
    void showDialog();

public slots:
    void toggledButton_Help();
    void toggledButton_Apply();
    void toggledButton_Reset();
    
signals:
    /// Fired when user requires filter to run
    void requestedExectuteFilter(FilterPlugin* filter, RichParameterSet* parameters);
};
